package state;

public class GumballMechine
{

	
	State soldOutState;
	State noQuarterState;
	State hasQuarterState;
	State soldState;
	
	State state = soldOutState;
	int count = 0;
	
	public GumballMechine(int numberGumballs){
		soldOutState = new SoldOutState(this);
		noQuarterState = new NoQuarterState(this);
		hasQuarterState = new HasQuarterState(this);
		soldState = new SoldState(this);
		this.count = numberGumballs;
		if(numberGumballs>0)
		{
			this.state = noQuarterState;
		}
	}
	
	public void setState(State s){
		this.state = s;
	}

	public State getHasQuarterState()
	{
		// TODO Auto-generated method stub
		return state;
	}
}
